def qu_sort(li, left, right):
    tmp = li[left]
    while left < right:
        while left < right and li[right] >= tmp:
            right -= 1
        li[left] = li[right]
        while left < right and li[left] <= tmp:
            left += 1
        li[right] = li[left]
    li[left] = tmp
    return left

def quick_sort(li, left, right):
    if left < right:
        min = qu_sort(li, left, right)
        quick_sort(li, left, min-1)
        quick_sort(li, min+1, right)

li = [1,16,43,16,84,12,3,684,654,64,5]
quick_sort(li,0,len(li)-1)
print(li)
